package com.ruoyi.control.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.control.mapper.UseElectricityHistoryMapper;
import com.ruoyi.control.domain.UseElectricityHistory;
import com.ruoyi.control.service.IUseElectricityHistoryService;

/**
 * 智能用电历史Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-18
 */
@Service
public class UseElectricityHistoryServiceImpl implements IUseElectricityHistoryService
{
    @Autowired
    private UseElectricityHistoryMapper useElectricityHistoryMapper;

    /**
     * 查询智能用电历史
     *
     * @param id 智能用电历史主键
     * @return 智能用电历史
     */
    @Override
    public UseElectricityHistory selectUseElectricityHistoryById(String id)
    {
        return useElectricityHistoryMapper.selectUseElectricityHistoryById(id);
    }

    /**
     * 查询智能用电历史列表
     *
     * @param useElectricityHistory 智能用电历史
     * @return 智能用电历史
     */
    @Override
    public List<UseElectricityHistory> selectUseElectricityHistoryList(UseElectricityHistory useElectricityHistory)
    {
        return useElectricityHistoryMapper.selectUseElectricityHistoryList(useElectricityHistory);
    }

    /**
     * 新增智能用电历史
     *
     * @param useElectricityHistory 智能用电历史
     * @return 结果
     */
    @Override
    public int insertUseElectricityHistory(UseElectricityHistory useElectricityHistory)
    {
        return useElectricityHistoryMapper.insertUseElectricityHistory(useElectricityHistory);
    }

    /**
     * 修改智能用电历史
     *
     * @param useElectricityHistory 智能用电历史
     * @return 结果
     */
    @Override
    public int updateUseElectricityHistory(UseElectricityHistory useElectricityHistory)
    {
        useElectricityHistory.setUpdateTime(DateUtils.getNowDate());
        return useElectricityHistoryMapper.updateUseElectricityHistory(useElectricityHistory);
    }

    /**
     * 批量删除智能用电历史
     *
     * @param ids 需要删除的智能用电历史主键
     * @return 结果
     */
    @Override
    public int deleteUseElectricityHistoryByIds(String[] ids)
    {
        return useElectricityHistoryMapper.deleteUseElectricityHistoryByIds(ids);
    }

    /**
     * 删除智能用电历史信息
     *
     * @param id 智能用电历史主键
     * @return 结果
     */
    @Override
    public int deleteUseElectricityHistoryById(String id)
    {
        return useElectricityHistoryMapper.deleteUseElectricityHistoryById(id);
    }
}
